package com.pin.si.www.framework.apidoc.properties;

import com.pin.si.www.framework.apidoc.enums.OpenApiConfigConstants;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * OpenAPI 配置属性
 *
 * @author bin
 */
@Data
@Component
@ConfigurationProperties(prefix = OpenApiConfigConstants.OPENAPI_PREFIX)
public class OpenApiProperties {
    /**
     * 是否启用 OpenAPI 文档
     */
    private boolean enabled = true;
    /**
     * 应用信息
     */
    private AppInfo info = new AppInfo();
    /**
     * 联系人信息
     */
    private Contact contact = new Contact();
    /**
     * 许可证信息
     */
    private License license = new License();
    /**
     * 外部文档信息
     */
    private ExternalDocs externalDocs = new ExternalDocs();

    @Data
    public static class AppInfo {
        /**
         * 应用标题
         */
        private String title = "knife4j API 文档";
        /**
         * 应用版本
         */
        private String version = "1.0.0";
        /**
         * 应用描述
         */
        private String description = "knife4j API 文档，提供系统所有 RESTful API 接口说明";
    }

    @Data
    public static class Contact {
        /**
         * 联系人姓名
         */
        private String name = "bin";
        /**
         * 联系人邮箱
         */
        private String email = "bin.1024@qq.com";
        /**
         * 联系人网址
         */
        private String url = "https://blog.csdn.net/qq_42470947";
    }

    @Data
    public static class License {
        /**
         * 许可证名称
         */
        private String name = "Apache 2.0";
        /**
         * 许可证URL
         */
        private String url = "https://blog.csdn.net/qq_42470947";
    }

    @Data
    public static class ExternalDocs {
        /**
         * 外部文档描述
         */
        private String description = "knife4j API 外部开发文档";
        /**
         * 外部文档URL
         */
        private String url = "https://blog.csdn.net/qq_42470947";
    }

}
